'(paint screen-1 pattern-choice checkered)
Assuming that the checkered button has a resource for its label string named label and another resource for the label font named font, then the complete names for these resources would obviously be:
'(paint screen-1 pattern-choice checkered label) '(paint screen-1 pattern-choice checkered font)
As you might expect when dealing with long path names like these, it's often useful to insert ``wildcards'' in the places where you don't want to be so specific. For example, the following resource name would refer to the font of everything in the pattern choice contact, regardless of the screen where it appears:
'(paint * pattern-choice * font)
Another way of identifying a contact is by its object class. So, for example, you could refer to the font of every button object in the paint program with the following resource name.
'(paint * button font)
By associating values with these sorts of resource names in resource bindings, a user can create a resource database which represents his UI preferences. CLUE provides a define-resources macro for adding resource bindings to the database.
(define-resources (paint * button background) white (paint * pattern-choice * font) helvetica-12 (paint * pattern-choice checkered label) "Checkered")
CLUE automatically reads the resource database whenever a contact is created. A contact has a class and possibly other contact superclasses on its class precedence list. Each such (super)class has a list of resource names that it uses (defined by the :resources option of the defining defcontact form). Together, these form the set of contact resources that are looked up in the resource database. Of course, finding a resource value is rather complicated, because names in the database may not be complete resource names and may contain a mixture of resource names and class symbols. Nevertheless, during initialization, CLUE will find the resource binding that is the closest match for each contact resource. In general, a contact gets its resource values first from the user's resource database, then from programmer-specified defaults when no user value is found.